<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Document</title>
<style>
  .content{
    width: 200px;
    height: 200px;
    border: 1px solid #333;
    text-align: center;
    line-height: 200px;
    font-size: 30px;
  }
  button.active{
    background-color: red;
  }
</style>
</head>
<body>

  <div id='app'>
    <button :class="{active: num == 0}" @click="changeTab(0)">标题1</button>
    <button :class="{active: num == 1}" @click="changeTab(1)">标题2</button>
    <button :class="{active: num == 2}" @click="changeTab(2)">标题3</button>
    <div v-show="num==0" class="content">内容1</div>
    <div v-show="num==1" class="content">内容2</div>
    <div v-show="num==2" class="content">内容3</div>
  </div>

<script src='https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js'></script>
<script>
  const app = new Vue({
    el: '#app'
    ,data:{
      num: 0
    }
    ,methods: {
      changeTab(n){
        this.num = n;
      }
    }
  })
</script>
</body>
</html>